/***************************************************************************
 *   This file is a part of match.                               *
 *   Copyright (C) 2009 by fu4ny 										   *
 *   ntcong.it@gmail.com                                                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *  You should have received a copy of the GNU General Public License      * 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>   *             *
 ***************************************************************************/

#ifndef SURFDB_H_
#define SURFDB_H_
#include "common/IPoint.h"
#include <string>
#include <vector>
using namespace std;

typedef vector< IPoint > tSurf;

class SurfDB {
public:
	SurfDB();
	void load( const char* );//Load the file in surf format

	void write( const char* );//Write the file in surf format
	//Backward compatible loading for the old surf format,it's used by orginal surf generator
	//Note that this file should have only 1 image.
	void loadCom( const char*, double, double );// You must provide id and pose here, because the old format doesn't have it

	//Delete a image from db
	void remove( double , double );

	//Add a image to db
	void addImg( const char* );
	void addImg( const char*, int, int );

	int size();
	int dim();
	virtual ~SurfDB();
private:
	tSurf list;
	int numberOfVector;
	int dimension;
};

/*
 * Dev Note: Surf Format :
 * 		dimension
 * 		numberOfVector
 * 		obj_id pose vector_number List< vector >
 *
 * 		Surf Compatible
 * 		dimension
 * 		numberOfVector
 * 		x y a b c lap List< vector >
 *
 * 		We just ignore x y a b c lap now, since we don't use it
 */
#endif /* SURFDB_H_ */
